<!DOCTYPE html>

<meta charset="utf-8" />	

<form class="form-horizontal" role="form"  onsubmit="return submitForm(this);"
 action="mpamng/term/eidtTerm.do" id="termCom_form">
	<!-- #section:elements.form -->
	<br/>
	<!-- 用户  -->
	<input type="hidden" name="id" />
	
	<div class="form-group">
		<label class="col-sm-3 control-label no-pEditing-right" for="form-field-4">终端厂商：</label>
		<div class="col-sm-9">
			<label>
				<div class="search_input" style="pEditing-top: 5px;">
					<select 
					 rel="obj.options"
					 location="mpamng/selectoption/termCom.do" 
					 name="terminalCom" 
					 id="terminalCom1" 
					 data-placeholder="请选择状态" style="width: 200px;vertical-align:middle;">
						<option value='' >----请选择----</option>
					 </select>
				</div>
			</label>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label no-pEditing-right" for="form-field-4">终端类型：</label>
		<div class="col-sm-9">
			<label>
				<div class="search_input" style="pEditing-top: 5px;">
					<select 
					 rel="obj.options"
					 location="mpamng/selectoption/termType.do" 
					 name="terminalType" 
					 id="terminalType1" 
					 data-placeholder="请选择状态" style="width: 200px;vertical-align:middle;">
						<option value='' >----请选择----</option>
					 </select>
				</div>
			</label>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-3 control-label no-pEditing-right" for="form-field-1"> 数量： </label>
		<div class="col-sm-9">
			<input type="text" id="add_termTotalnum" name="termAllocateNum" placeholder="" class="col-xs-10 col-sm-7" validate="true" datatype="number"/>
		</div>
	</div>

	<div class="form-group">
			
		
	</div>
	<br/><br/>
	<div class="form-actions align-right  form-button-box" style="margin-top: 10px">
		<button class="btn btn-info" type="submit">生成</button>
		&nbsp; 
		<button class="btn" type="button" onclick="javascript:dialog.closeById('dlg-termEdit');">关闭</button>
	</div>
	
</form>
<script type="text/javascript">
function submitForm(obj){
	var terminalCom1=$("#terminalCom1 option:selected").val();
	if (terminalCom1 == ''||terminalCom1 == null){
		alertMsg.error('请选择终端厂商');
		return false;
	}
	var terminalType1=$("#terminalType1 option:selected").val();
	if (terminalType1 == ''||terminalType1 == null){
		alertMsg.error('请选择终端类型');
		return false;
	}
	var termTotalnum=$("#add_termTotalnum").val();
	if (termTotalnum == ''||termTotalnum == null||termTotalnum =='0'){
		alertMsg.error('请填写终端数量且数量不能为  0');
		return false;
	}
	return validateCallback(obj,editUserDone);
}


function editUserDone(result){
	dialogAjaxDone(result);
	if(result.rspcod== 200){
		msg.alert("提示",result.rspmsg,'correct');
		$("#grid-table").trigger("reloadGrid");
		dialog.closeById('dlg-termEdit');
	}else{
		msg.alert("错误",result.rspmsg+" 错误代码："+result.rspcod,'error');
	}
}

</script>
